package com.example.sofa_module.sofa.details;

import com.example.baserecyclerview.quick.BaseQuickAdapter;
import com.example.baserecyclerview.quick.BaseViewHolder;
import com.example.sofa_module.R;
import com.example.sofa_module.sofa.details.entity.DetakisEntity;

import java.text.SimpleDateFormat;

public class DetailsAdapter extends BaseQuickAdapter<DetakisEntity, BaseViewHolder> {

    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM--dd HH:mm:ss");

    public DetailsAdapter() {
        super(R.layout.item_details);
    }

    @Override
    public void convert(BaseViewHolder holder, DetakisEntity item) {
        holder.setText(R.id.details_text,item.commentText);
        holder.setText(R.id.details_tv,item.author.name);
        holder.setText(R.id.details_time,simpleDateFormat.format(item.createTime));
        holder.setImageyun(R.id.details_img,item.imageUrl);
    }
}
